﻿<!DOCTYPE html>
<html lang="en">
<head th:replace="~{parts/head}">

<!-- page wrapper -->
<body>

    <div class="boxed_wrapper">

        <!-- preloader -->
        <div class="preloader"></div>
        <!-- preloader -->


        <!-- main header -->
        <header class="main-header style-three">

            <!-- header-lower -->
            <div class="header-lower">
                <div class="outer-box clearfix">
                    <div class="left-column">
                        <div class="logo-box">
                            <figure class="logo"><a href="/"><img src="../../images/logo-3.png" alt=""></a></figure>
                        </div>
                        <div th:replace="~{parts/menu-area}">
                    </div>
                    <div class="right-column pull-right">
                        <div th:replace="~{parts/author-box}">
                    </div>
                </div>
            </div>

            <!--sticky Header-->
            <div class="sticky-header">
                <div class="auto-container">
                    <div class="outer-box">
                        <div class="logo-box">
                            <figure class="logo"><a href="/"><img src="../../images/small-logo.png" alt=""></a></figure>
                        </div>
                        <div class="menu-area">
                            <nav class="main-menu clearfix">
                                <!--Keep This Empty / Menu will come through Javascript-->
                            </nav>
                        </div>
<!--                        <div class="btn-box"><a href="register-page.html" class="theme-btn-one"><i class="icon-image"></i>Join Now</a></div>-->
                    </div>
                </div>
            </div>
        </header>
        <!-- main-header end -->

        <!-- Mobile Menu  -->
        <div class="mobile-menu">
            <div class="menu-backdrop"></div>
            <div class="close-btn"><i class="fas fa-times"></i></div>
            
            <nav class="menu-box">
                <div class="nav-logo"><a href="/"><img src="../../images/logo-2.png" alt="" title=""></a></div>
                <div class="menu-outer"><!--Here Menu Will Come Automatically Via Javascript / Same Menu as in Header--></div>
                <div class="contact-info">
                    <h4>Contact Info</h4>
                    <ul>
                        <li>Chicago 12, Melborne City, USA</li>
                        <li><a href="">+88 01682648101</a></li>
                        <li><a href="mailto:info@example.com">info@example.com</a></li>
                    </ul>
                </div>
                <div class="social-links">
                    <ul class="clearfix">
                        <li><a href="/"><span class="fab fa-twitter"></span></a></li>
                        <li><a href="/"><span class="fab fa-facebook-square"></span></a></li>
                        <li><a href="/"><span class="fab fa-pinterest-p"></span></a></li>
                        <li><a href="/"><span class="fab fa-instagram"></span></a></li>
                        <li><a href="/"><span class="fab fa-youtube"></span></a></li>
                    </ul>
                </div>
            </nav>
        </div><!-- End Mobile Menu -->


        <!--page-title-two-->
        <section class="page-title-two">
            <div class="title-box centred bg-color-2">
                <div class="pattern-layer">
                    <div class="pattern-1" style="background-image: url(../../images/shape/shape-70.png);"></div>
                    <div class="pattern-2" style="background-image: url(../../images/shape/shape-71.png);"></div>
                </div>
                <div class="auto-container">
                    <div class="title">
                        <h1>挂号处管理</h1>
                    </div>
                </div>
            </div>
            <div class="lower-content">
                <ul class="bread-crumb clearfix">
                    <li><a href="/">主页</a></li>
                    <li><a style="cursor: pointer" onclick="window.history.back(-1);">上一页</a></li>
                    <li>挂号处管理</li>
                </ul>
            </div>
        </section>
        <!--page-title-two end-->


        <!-- doctors-dashboard -->
        <section class="doctors-dashboard bg-color-3">
            <div class="left-panel">
                <div class="profile-box">
                    <div class="upper-box">
                        <figure class="profile-image"><img th:src="${admin.icon}" alt=""></figure>
                        <div class="title-box centred">
                            <div class="inner">
                                <h3 th:text="${admin.name}">Dr. Rex Allen</h3>
<!--                                <p>MDS - Periodontology</p>-->
                            </div>
                        </div>
                    </div>
                    <div class="profile-info">
                        <ul class="list clearfix">
                            <th:block th:replace="~{parts/admin-user-dash}"></th:block>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="right-panel">
                <div class="content-container">
                    <div class="outer-container">
                        <div class="doctors-appointment my-patients">
                            <div class="title-box clearfix">
                                <div class="text pull-left">
                                    <h3>挂号处列表</h3>
                                </div>
                                <div class="btn-box pull-right">
                                    <form action="my-patients.html" method="post" class="search-form">
                                        <div class="form-group">
                                            <input type="search" name="search-field" placeholder="搜索" required="">
                                            <button type="submit"><i class="far fa-search"></i></button>
                                        </div>
                                    </form>
                                    <a href="/admin-checkin-detail" class="theme-btn-one">新增<i class="icon-image"></i></a>
                                </div>
                            </div>
                            <div class="doctors-list">
                                <div class="table-outer">
                                    <table class="doctors-table">
                                        <thead class="table-header">
                                            <tr>
                                                <th>姓名</th>
                                                <th>性别</th>
                                                <th>地址</th>
                                                <th>手机</th>
                                                <th>年龄</th>
                                                <th>血型</th>
                                                <th>操作</th>
<!--                                                <th>&nbsp;</th>-->
                                            </tr>    
                                        </thead>
                                        <tbody>
                                            <tr th:each="item:${checkins}">
                                                <td>
                                                    <div class="name-box">
                                                        <figure class="image"><img th:src="${item.icon}" alt=""></figure>
                                                        <h5 th:text="${item.name}">Mary Astor</h5>
                                                    </div>
                                                </td>
                                                <td>
                                                    <p th:text="${item.formatGender}">Male</p>
                                                </td>
                                                <td>
                                                    <p th:text="${item.address}">Flat 20, Reynolds Neck, NY</p>
                                                </td>
                                                <td>
                                                    <p th:text="${item.phone}">+(22) 65_458_856</p>
                                                </td>
                                                <td>
                                                    <p th:text="${item.age + '岁'}">29 Yrs</p>
                                                </td>
                                                <td>
                                                    <p th:text="${item.blood}">O+</p>
                                                </td>
                                                <td>
                                                    <span class="accept" style="cursor: pointer" th:data-item_id="${item.id}" onclick="editItem(this.getAttribute('data-item_id'))"><i class="fas fa-pencil-alt"></i>编辑</span>
                                                    <span class="cancel" style="cursor: pointer" th:data-item_id="${item.id}" onclick="deleteItemConfirm(this.getAttribute('data-item_id'))"><i class="fas fa-times"></i>删除</span>
                                                </td>
                                            </tr>

                                        </tbody>    
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- doctors-dashboard -->


        <!-- main-footer -->
        <div th:replace="~{parts/main-footer}"></div>
        <!-- main-footer end -->
        <div th:replace="~{parts/alert-modal}"></div>

        <!--Scroll to top-->
        <button class="scroll-top scroll-to-target" data-target="html" onclick='location.href=("/message?targetId=6")'>
            <img src="../../images/robot-2.png">
        </button>
    </div>


    <script th:replace="~{parts/js}"></script>
    <script>
        $('#admin-checkin').addClass("current");
        $('#admin_tab').addClass("current");
        function editItem(id) {
            window.location.href='/admin-checkin-detail?id='+id;
        }
        function deleteItemConfirm(id) {
            itemId = id;
            $('#deleteModal').modal('show');
        }
        function deleteItem() {
            $.ajax({
                type: "post",
                url:"/admin-users-detail/delete",
                cache: false,
                data: {
                    id: itemId
                },
                success: function (data) {
                    if (data.state === "success") {
                        $('#deleteSuccessModal').modal('show');
                    }
                },
                error: function(res) {
                    $('#deleteFailModal').modal('show');
                }
            });

        }
    </script>

</body><!-- End of .page_wrapper -->
</html>
